import request from '@/utils/request'

let PageApi = {

  /*获取数据*/
  detail(data, errorback) {
    return request._post('/supplier/page.page/detail', data, errorback);
  },
  /*上架样式*/
  toAddPage(data, errorback) {
    return request._get('/supplier/page.page/add', data, errorback);
  },
  /*上架样式*/
  addPage(data, errorback) {
    return request._post('/supplier/page.page/add', data, errorback);
  },
  /*页面列表*/
  PageList(data, errorback) {
    return request._post('/supplier/page.page/index', data, errorback);
  },
  /*删除页面*/
  deletePage(data, errorback) {
    return request._post('/supplier/page.page/delete', data, errorback);
  },
  /*设为首页*/
  setHome(data, errorback) {
    return request._post('/supplier/page.page/setHome', data, errorback);
  },

  /*编辑页面*/
  editPage(data, errorback) {
    return request._get('/supplier/page.page/edit', data, errorback);
  },
  /*保存编辑页面*/
  SavePage(data, errorback) {
    return request._post('/supplier/page.page/edit', data, errorback);
  },
  /*获取分类*/
  getCategory(data, errorback) {
    return request._get('/supplier/page.page/category', data, errorback);
  },
  /*提交分类*/
  postCategory(data, errorback) {
    return request._post('/supplier/page.page/category', data, errorback);
  },
  /*获取导航*/
  getNav(data, errorback) {
    return request._get('/supplier/page.page/nav', data, errorback);
  },
  /*提交导航*/
  postNav(data, errorback) {
    return request._post('/supplier/page.page/nav', data, errorback);
  },
  /*广告列表*/
  menuList(data, errorback) {
    return request._post('/supplier/page.page.Mymenu/index', data, errorback);
  },
  /*添加广告*/
  addMenu(data, errorback) {
    return request._post('/supplier/page.page.Mymenu/add', data, errorback);
  },
  /*广告详情*/
  menuDetail(data, errorback) {
    return request._get('/supplier/page.page.Mymenu/detail', data, errorback);
  },
  /*修改广告*/
  editMenu(data, errorback) {
    return request._post('/supplier/page.page.Mymenu/edit', data, errorback);
  },
  /*删除广告*/
  deleteMenu(data, errorback) {
    return request._post('/supplier/page.page.Mymenu/delete', data, errorback);
  },

  /*首页模板列表*/
  HomeList(data, errorback) {
    return request._post('/supplier/page.page/list', data, errorback);
  },
  /*设为首页*/
  setPage(data, errorback) {
    return request._post('/supplier/page.page/setPage', data, errorback);
  },
  /*编辑页面*/
  getHome(data, errorback) {
    return request._get('/supplier/page.page/addPage', data, errorback);
  },
  /*保存编辑页面*/
  addhome(data, errorback) {
    return request._post('/supplier/page.page/addPage', data, errorback);
  },
  getEdit(data, errorback) {
    return request._get('/supplier/page.page/editPage', data, errorback);
  },
  editHome(data, errorback) {
    return request._post('/supplier/page.page/editPage', data, errorback);
  },
  /*主题详情*/
  themeDetail(data, errorback) {
    return request._get('/supplier/page.theme/index', data, errorback);
  },
  /*修改广告*/
  editTheme(data, errorback) {
    return request._post('/supplier/page.theme/index', data, errorback);
  },
  /*获取导航*/
  getbottomNav(data, errorback) {
    return request._get('/supplier/page.page/bottomnav', data, errorback);
  },
  editTabbar(data, errorback) {
    return request._post('/supplier/page.page/bottomedit', data, errorback);
  },
  categoryList() {
    return request._post('/supplier/page.page/categoryList', {}, true);
  },
  getRegions(data) {
    return request._post('/supplier/page.page/getRegions', data, true);
  },
  copyPage(param) {
    return request._post('/supplier/page.page/copyPage', param, true);
  }
}

export default PageApi;
